home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
System Booster
/
System Booster.iso
/
SYS
/
s
/
open.wrx
< prev
next >
Wrap
Text File
|
1996-09-26
|
2KB
|
121 lines
/*
* WRITE V3.000 © 1991-1993 by Tim Teulings startup script
* for ideal use set sleep mode in the configuration file
* This script was done by MGR, Asgrad -- Lars Hanke
* no copyrights claimed
*
* this script takes a filename as argument. If the other
* argument equals "run", control returns to shell immediately.
*
* screen flag added vor WRITE V3.000
* if one is argument is "screen" then screen is brought to front when
* starting and to the back again when quitting. Usefull for starting
* WRITE from other screens.
* Tim Teulings.
*
*/
IF ~show('P',"WRITE")
THEN DO
IF Open(File,"ENV:WRITE",r) THEN DO
WRITEPATH = READLN(File)
Close(File)
ADDRESS "COMMAND"
"run >NIL: <NIL: " || WRITEPATH
"SYS:REXXC/WaitForPort <NIL: >NIL: WRITE"
END
ELSE DO
say "Kann WRITE nicht finden !"
END
END
PARSE ARG A.1 A.2 A.3
runit = FALSE
screenit = FALSE
FileName = ""
DO i = 1 TO 3
IF A.i="#run" THEN DO
runit = TRUE
END
ELSE DO
IF A.i="#screen" THEN DO
screenit = TRUE
END
ELSE DO
IF A.i~="" THEN DO
FileName=A.i
END
END
END
END
FileName=strip(FileName)
FileName=strip(FileName,'B','"')
IF length(FileName)~=0
THEN DO
IF pos(':',FileName)=0
THEN DO
DirName=pragma('D')
IF right(DirName,1)~=':' THEN
DirName=DirName||'/'
FileName=DirName||FileName
END
END
ADDRESS "WRITE"
OPTIONS RESULTS
'VERSIONCHECK 3848 "open.wrx"'
IF RC~=0 THEN DO
exit 10
END
'NEWED ""'
ID = RESULT
OPENPORT ID
Port = RESULT
IF Port = ""
THEN DO
"MESSAGEOK (REXX-script 'open.wrx' :\nSorry, no more private ports!)"
EXIT
END
INTERPRET ADDRESS Port
"WINDOW 0 0 0 0"
"SETVAR (_Path) ("||FileName||")"
IF length(FileName)~=0 THEN DO
IF exists(FileName) then
"OPEN ("||FileName||")"
ELSE
"SETVAR (_FileName) ("||FileName||")"
END
ELSE DO
FileName=pragma('D')
IF right(FileName,1)~=':' THEN
FileName=FileName||'/'
"SETVAR (_Path) ("||FileName||")"
END
IF (screenit = TRUE) & (runit = FALSE) THEN DO
MODIFYSCREEN 0
END
IF (runit = FALSE) THEN DO
WAITPORT ID
END
IF (screenit = TRUE) & (runit = FALSE) THEN DO
IF show('P',"WRITE") THEN DO
ADDRESS "WRITE"
MODIFYSCREEN 1
END
END